<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>睿信培训</title>
    <link rel="stylesheet" href="../dist/lib/layui/css/layui.css">
    <style>
        .content{
            width: 1000px;
            height: auto;
            padding: 50px 0 0;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="content">
        <button class="layui-btn" id="infoBtn">信息</button>
    </div>

<script src="../dist/lib/layui/layui.js"></script>
<script>
    layui.use(['element', 'form'], function(){
        var $ = layui.$,
            element = layui.element,
            form = layui.form;

        function getHrefContent(href, option) {
            var content = '';
            $.ajax({
                url: href,
                type: 'get',
                dataType: 'html',
                async: false,
                success: function (data) {
                    content = data;
                },
                error: function (xhr, textstatus, thrown) {
                    return layer.msg('Status:' + xhr.status + '，' + xhr.statusText + '，请稍后再试！');
                }
            });
            return content;
        }


        $('#infoBtn').click(function () {
            var content = getHrefContent('testDialog.html');
            layer.open({
                title: '信息',
                area: '1000px',
                type: 1,
                shade: 0.2,
                shadeClose: true,
                content: content,
                btn: false
            });
        })

    });
</script>
</body>
</html>